using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;

namespace HDS.Model.Entity.Log
{
    /// <summary>
    /// 修改日志 
    /// </summary>
    [SugarTable("update_log")]
    public class UpdateLog
    {

        /// <summary>
        /// 自增id
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnName = "log_id")]
        public int LogId { get; set; }

        /// <summary>
        /// 日志类型
        /// </summary>
        [SugarColumn(ColumnName = "log_type")]
        public UpdateLogType LogType { get; set; }

        /// <summary>
        /// 日志子类型
        /// </summary>
        [SugarColumn(ColumnName = "log_sub_type")]
        public string LogSubType { get; set; }

        /// <summary>
        /// 业务id
        /// </summary>
        [SugarColumn(ColumnName = "business_id")]
        public string BusinessId { get; set; }

        /// <summary>
        /// 日志级别
        /// </summary>
        [SugarColumn(ColumnName = "log_level")]
        public LogLevel LogLevel { get; set; } = LogLevel.Information;

        /// <summary>
        /// 日志内容
        /// </summary>
        [SugarColumn(ColumnName = "log_text")]
        public string LogText { get; set; }

        /// <summary>
        /// 更新人id
        /// </summary>
        [SugarColumn(ColumnName = "updated_by")]
        public int UpdatedBy { get; set; }

        /// <summary>
        /// 更新人姓名
        /// </summary>
        [SugarColumn(ColumnName = "updated_by_name")]
        public string UpdatedByName { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        [SugarColumn(ColumnName = "updated_time")]
        public DateTime UpdatedTime { get; set; }

    }

    public enum UpdateLogType
    {
        [Description("数据操作")]
        StaticData = 1,
        [Description("订单操作")]
        Order = 5,
        [Description("应用消息")]
        AppMessage = 10,
    }
}
